//1、导入 request请求工具
import axios from "@/utils/request";
// 2、导入路径 path
import path from "./path";


//定义一个api对象
const api = {
   //查询所有化妆信息
    getMakeAll(){
        return axios.get(path.baseUrl + path.getMakeAll)
    },
    //查询所有化妆信息带分页
    getMakeByPage(page){
        return axios.get(path.baseUrl + path.getByPageMake,{params:page})
    },
    //注册化妆
    addMake(make){
        return axios.post(path.baseUrl + path.addMake,make)
    },
    //修改化妆信息
    updateMake(make){
        return axios.put(path.baseUrl + path.updateMake,make)
    },
    //删除化妆信息
    deleteMake(id){
        //解析参数，拼接
        const param = new URLSearchParams;
        //key值需要与后台形参一致
        param.append("id",id)
        return axios.patch(path.baseUrl + path.deleteMake,param) 
    }
   
}

//导出api
export default api;